/**
 * @param {string} s
 * @return {string}
 */
 var greatestLetter = function(s) {
  let res=""
  for(let i=0;i<s.length;i++){
    if(s[i]>='a'&& s[i]<='z'){
      if(s.includes(String.fromCharCode(s[i].charCodeAt()-32))){
        res = s[i].toLocaleUpperCase()>res?s[i].toLocaleUpperCase():res
      }
    }
  
  }

  return res
};

greatestLetter([1,1,2])